include Bzflag

class KillJan < Plugin

  def initialize(args = nil)
    @args = args
    @timelimit_cmd = "/killjan"
  end

  def unknown_slash_command(event_data)  
    cmd = event_data.message.downcase.split[0]
    killer_id = event_data.from
    
    if cmd != @timelimit_cmd
      return false
    else
      killJan(killer_id)
      event_data.handled = true      
      return true
    end
        
  end
  
  def killJan(killerID)
    ids = bz_get_player_index_list
    ids.each do |id|
      player = Player.new(id)
      if (player.callsign == "jan the man")
        bz_kill_player(player.player_id, killerID)
      end
    end
  end
  
end

puts "YABZS :: killjan"
killjan = KillJan.new()
killjan.register



